package cn.lei.uicontrols;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

public class AtyUsingSpinner extends AppCompatActivity {

    private Spinner mSpinner;
    private ArrayAdapter<String> mAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_aty_using_spinner);

        mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1);
        mAdapter.add("Hello");
        mAdapter.add("World");
        mAdapter.add("ni hao");

        mSpinner = (Spinner) findViewById(R.id.spinner);
        mSpinner.setAdapter(mAdapter);
    }
}
